package com.wanjl.ssm01.mapper;

import com.wanjl.ssm01.entity.Person;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author WanJl
 * @version 1.0
 * @title PersonMapper
 * @description
 * @create 2024/11/14
 */
@Repository
public interface PersonMapper {
    @Select("SELECT * FROM person")
     List<Person> selectAll();

    @Insert("INSERT INTO person VALUES (#{id},#{name},#{age})")
    Integer insert(Person person);

    @Delete("DELETE FROM person WHERE id=#{id}")
    Integer delete(Integer id);
}
